package com.musifind.activities;

import java.util.Arrays;
import java.util.List;

import android.support.v4.app.FragmentActivity;

import com.facebook.Session;

public class MusiFindFragmentActivity extends FragmentActivity {

	// for both class that named WelcomeActivity and HomePage, we will use this
	// fragment activity
	// permissions and sessions will be handled through this activity
	private static final List<String> PERMISSIONS = Arrays.asList("publish_actions", "user_status", "user_photos",
			"user_about_me", "email", "user_birthday");

	public boolean checkPermissions() {
		Session s = Session.getActiveSession();
		if (s != null) {
			return s.getPermissions().contains("publish_actions");
		} else
			return false;
	}

	public void requestPermissions() {
		Session s = Session.getActiveSession();
		if (s != null)
			s.requestNewPublishPermissions(new Session.NewPermissionsRequest(this, PERMISSIONS));
	}

}
